#include "staffmanagerform2.h"
#include "ui_staffmanagerform2.h"
#include "changestaffwindow.h"

staffManagerForm2::staffManagerForm2(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::staffManagerForm2)
{
    ui->setupUi(this);


}
staffManagerForm2::staffManagerForm2(const QString &name, const QString &duty, const QString &password, QWidget *parent):
    QWidget(parent),
    ui(new Ui::staffManagerForm2)
{
    ui->setupUi(this);
    ui->nameLabel->setText(name);
    ui->dutyLabel->setText(duty);
    ui->passwordLabel->setText(password);
    changeStaffWindow* p1=dynamic_cast<changeStaffWindow*>(parent);
    connect(this,&staffManagerForm2::delStaff,p1,&changeStaffWindow::deleteStaff);
}
staffManagerForm2::~staffManagerForm2()
{
    delete ui;
}

void staffManagerForm2::on_pushButton_clicked()
{

    emit delStaff(ui->nameLabel->text());
}
